let express = require('express');
let router = express.Router();
let filter = require('../../components/filter');

/**
 * 查看身份证数据 by p 2018-08-30
 *
 * 按id查看指定的身份证信息
 */
router.get('/:id', filter.authorize, function (req, res, next) {
    let params = req.params;

    req.app.db.query("select * from idcard where id = ?", [params.id], function (err, results, fields) {
        if (err) {
            res.json({"success": false, "message": global.databaseErr, "detail": err});
            return;
        }

        res.json({"success": true, "data": results});
    });
});

module.exports = router;